GBML manual / Backgrounds

perspective_floor_scale

How big something standing at the point of the last perspective_floor_project call should be drawn: 1 is its real size on the picture, 0.5 half of it. It shrinks toward the horizon.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet - The Sega Genesis will draw the road its own way.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

perspective_floor_scale() -> real

Returns

real

Description

How big something standing at the point of the last perspective_floor_project call should be drawn: 1 is its real size on the picture, 0.5 half of it. It shrinks toward the horizon. Hand it to draw_sprite_scaled, or set xscale and yscale, to size a rival car or a pickup. It is 0 before any call, and after a call that said false.

Example

if (perspective_floor_project(300, 640)) {
    xscale = perspective_floor_scale();
    yscale = xscale;
}

The instance is drawn as big as the road under it makes it look.

On the GBA

Hand it to draw_sprite_scaled (or set xscale and yscale) to size a rival car or a pickup. 0 before any call, and after a call that said false.

See also: Perspective floorperspective_floor_projectdraw_sprite_scaledxscale